import type { UserInfo } from "./user";

export interface DrawerType {
  onShow: () => void;
}

export interface PaginationType {
  offset: number;
  limit: number;
}

export interface HomeBannerItem {
  pic: string;
  typeTitle: string;
  targetId: number;
  titleColor: string;
  bannerId: string;
  url?: string;
}

export interface UiElement {
  image: {
    imageUrl: string;
  };
  labelTexts: string[];
  mainTitle: {
    title: string;
    titleImgUrl: string;
  };
  subTitle: {
    title: string;
  };
}

export interface ResourcesItem {
  resourceExtInfo?: {
    eventMsg: string;
    hasListened: boolean;
    user: UserInfo;
  };
  resourceId: string;
  uiElement: UiElement;
}

export interface CreativeItem {
  creativeId: number;
  resources: ResourcesItem[];
  uiElement: UiElement;
}

export interface HomePageItem {
  blockCode:
    | "HOMEPAGE_BANNER"
    | "HOMEPAGE_BLOCK_OLD_DRAGON_BALL"
    | "HOMEPAGE_BLOCK_PLAYLIST_RCMD"
    | "HOMEPAGE_BLOCK_STYLE_RCMD"
    | "HOMEPAGE_BLOCK_MUS"
    | "HOMEPAGE_BLOCK_MGC_PLAYLIST"
    | "HOMEPAGE_MUSIC_MLOG"
    | "HOMEPAGE_BLOCK_HOT_TOPIC";
  extInfo?: {
    banners: HomeBannerItem[];
  };
  creatives: CreativeItem[];
  uiElement?: {
    subTitle: {
      title: string;
      canShowTitleLogo: false;
    };
    button: {
      text: string;
    };
  };
}

export interface CountryCodeItem {
  label: string;
  countryList: {
    zh: string;
    en: string;
    locale: string;
    code: string;
  }[];
}
